package marsrovers;

public class Point {
	
	private int x;
	
	public int getX() {
		return x;
	}

	public void setX(int x) {
		this.x = x;
	}

	public int getY() {
		return y;
	}

	public void setY(int y) {
		this.y = y;
	}

	private int y;
	
	public Point(int x, int y) {
		this.x = x;
		this.y = y;
	}
	
	public void advance(Orientation orientation) {
		if (orientation == Orientation.EAST) {
			x = x + 1;
		} else if (orientation == Orientation.NORTH) {
			y = y + 1;
		} else if (orientation == Orientation.WEST) {
			x = x - 1;
		} else if (orientation == Orientation.SOUTH) {
			y = y - 1;
		} else {
			throw new RuntimeException("Invalid orientation passed!");
		}
	}
	
	public String toString() {
		return "(" + x + "," + y + ")"; 
	}
	
}
